#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<random>
#include<algorithm>
#define N 30
#define M 1000000
using namespace std;
const int inf=(int)(1e9);
mt19937 RAND(random_device{}());
const int sx[4]={1,-1,0,0};
const int sy[4]={0,0,1,-1};
const char cs[3]={'R','G','B'};
const char cw[4]={'D','U','R','L'};
char rst[M+1],c[N+1][N+1];
int x,y,minn,p[4];
bool check(int x,int y)
{
	return 1<=x&&x<=N&&1<=y&&y<=N;
}
int calc(int x,int y)
{
	return max(abs(x-(N>>1)),abs(y-(N>>1)));
}
int main()
{
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	char d;
	string s;
	int ds;
	bool ops;
	for (int i=1;i<=N;++i)
		for (int j=1;j<=N;++j)
		{
			if (!((i+j)&1)) c[i][j]=cs[((((j-1)>>1)-(i-1))%3+3)%3];
			else c[i][j]=cs[((((N-j)>>1)-(i-1))%3+3)%3];
		}
	cin>>s;
	for (int opt=0;opt<=2;++opt)
		for (int opt2=0;opt2<=2;++opt2)
		{
			for (int i=1;i<=N;++i)
				for (int j=1;j<=N;++j)
				{
					if (!((i+j)&1)) c[i][j]=cs[((((j-1)>>1)-(i-1))%3+3+opt)%3];
					else c[i][j]=cs[((((N-j)>>1)-(i-1))%3+3+opt2)%3];
				}
			x=y=N>>1,ops=1;
			for (int i=0;i<s.length();++i)
			{
				d=s[i],minn=inf,ds=0;
				for (int j=0;j<=3;++j)
					if (check(x+sx[j],y+sy[j])&&c[x+sx[j]][y+sy[j]]==d&&calc(x+sx[j],y+sy[j])<minn)
						minn=calc(x+sx[j],y+sy[j]),ds=j;
				if (minn==inf)
				{
					ops=0;
					break;
				}
				x+=sx[ds],y+=sy[ds];
			}
			if (ops) break;
		}
	printf("%d %d\n",N,N);
	for (int i=1;i<=N;++i)
	{
		for (int j=1;j<=N;++j) printf("%c",c[i][j]);
		puts("");
	}
	x=y=N>>1;
	for (int i=0;i<s.length();++i)
	{
		d=s[i],minn=inf,ds=0;
		for (int j=0;j<=3;++j)
			if (check(x+sx[j],y+sy[j])&&c[x+sx[j]][y+sy[j]]==d&&calc(x+sx[j],y+sy[j])<minn)
				minn=calc(x+sx[j],y+sy[j]),ds=j;
		x+=sx[ds],y+=sy[ds];
		if (!i) printf("%d %d\n",x,y);
		else printf("%c",cw[ds]);
	}
	puts("");
	return 0;
}
